Repository navigation
feat(motion): reveal sections on scroll in CSS, and stop shipping them hidden - #42
Merged
Merged
Conversation
…m hidden Every section rendered opacity-0 on the server and faded in from a useEffect, all at once on load. The page was blank before hydration, blank for good without JavaScript, and still on scroll. The reveal is now a scroll timeline in globals.css behind a motion preference and an @supports check, so SectionFadeIn is a server component and the HTML is visible as sent. The hero text rises once on load using the design package durations. framer-motion had no importer and is removed. Closes #41
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…reveal some scale A straight 12px rise at ease-out read as stiff. The hero text now comes in over twice the slow token with a curve that overshoots and a blur that clears, and scrolled sections grow from 98.5% as they rise. The blur stays off the scroll reveal, where it would repaint a whole section on every frame. Refs #41
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #41
SectionFadeInis a server component now. The reveal is a.revealrule inglobals.cssonanimation-timeline: view(), gated behindprefers-reduced-motion: no-preferenceand an@supportscheck, so a section is visible in the HTML as sent. The hero text rises once on load with the design package's duration tokens, the two product cards start a few rem apart, and the card arrow moves 2px on hover.framer-motionis removed.Measured on the production build in headless Chromium at 1440x900:
With JavaScript disabled the page renders in full.
lib/motion.test.jsfailed three of its four tests before the change and passes after.Not checked: Safari, Firefox (expected to show no reveal), and any real device.